Skip to main content

Rate calculator

If the currency of received amount is not AED, please use this API to get the latest exchange rate.


API URL

UAT : https://uat.test2pay.com/sgs/api/transfer/calculateFundout

Production : https://api.payby.com/sgs/api/transfer/calculateFundout


Request

Http Header


Attributes

Content-Language String

The language in which the response message will be used, currently only English is supported.

Example value: en

Maximum length: 10


Content-Type String Required

The media type. Required for operations with a request body. The value is application/<format>, where format is json.

Example value: application/json


sign String Required

Requests should be signed using private-key cryptography. This allows the payment gateway to verify that an incoming request is really from your application.


Partner-Id String Required

The merchant id of your account.

Example value: 200001200101

Maximum length: 12


Http Body


requestTime Timestamp Required

Request time of the order. If the request time is more than 15 minutes away from the current time, the request will be rejected. This parameter is used to prevent repeated requests for orders that should have been cancelled due to timeouts.

Example value: 1581493898000


bizContent Object

The attributes are:

  • networkCode String Required

    The code of which transfer network is used in this payout.

    Example value: LOCAL, SWIFT

    Maximum length: 20


  • fundoutCurrencyCode String Required

    In this payout, the currency of the funds received by the beneficiary account.

    Example value: AED, USD.

    Maximum length: 20


  • orderAmount Money Required

    How much AED do you want to transfer.


Request sample

Http Header
{
"Content-Language": "en",
"Content-Type": "application/json",
"Partner-Id": "200000018128",
"sign": "S5Wr6x9Po1SX3nm4kRJyTueUMbnmsPGMlMjc3PcoyNyP0G5BuRAwauYjTJLeto6Bu1+893zCGmj201mjrvcXP4v/uMzQxRav5PBMp9VuQ+3dOFGclQAwr8cFAKuBDHhGAAkw1iVpdC8ZZLGl/jRUv3PCiZh6VyOLnrK7ZIevB/TetQSzCmN1xDIQo8mpDYz7YY/jSzYBnD17ePvkr4qQOWNUh7FF2nd29lo9KOQl5tJVoqT/D+PVSlZeuGr+wxBYCAyGqbVXXSAGcwF1egF6ISLJ29jpHcX/LACXxF/uf5cdzbudwPB2X0wtRw9WnowY3RUq34sidoF4DIShXVFHAg=="
}

Http Body
{
"requestTime":1585142880000,
"bizContent":{
"fundoutCurrencyCode":"USD",
"networkCode":"LOCAL",
"orderAmount":{
"amount":100,
"currency":"AED"
}
}
}

Response

Http Header


sign String Required

When PayBy sends response, PayBy will use its own private key to sign the message, and the merchant uses PayBy 's public key to verify the signature. If the verification is passed, it proves that the response was sent by PayBy and not faked by others.


Http Body


head

Attributes
  • applyStatus Enum Required

    The result of the request. The possible values are:

    SUCCESS - Application successful. FAIL - Application failed. Check the code and msg for exact reason. ERROR - Application error. The signature verification failed. Please check whether the private key used for the signature and the public key uploaded on the PayBy portal are one key pair.


  • code String Required

    Response Codes.

    Example value: 0


  • msg String

    Description of this code.


  • traceCode String

    No special meaning, PayBy internally used to locate the error.



body

Notice Body is returned only when applystatus = success, and code = 0. If applystatus = error or failed; or applystatus = success, code !=0 , that indicates an error. Please check errors and try again.

  • fundoutInfo Object

    The attributes are:

    • orderAmount Money Required How much AED do you want to transfer.


    • fundoutAmount Money Required

      How much money the beneficiary will receive.


    • feeAmount Money Required

      How much money PayBy will charge in this transaction.


    • networkCode String Required

      The code of which transfer network is used in this payout.

      Example value: LOCAL, SWIFT


    • rate String Required

      The exchange rate that AED to the currency of the received fund.

      Example value: IBAN, BBAN


Response sample

Http Header
{
"sign": "Yv+C2lOQmfERdm5GF9b2V4Y98HmX/6CFyconeOW36AoPqcb7InRcP9E5GnvJLfMoCScuNP4FBdJ5tJpL0A7yPHUMfxARi05jFRSMG97JJazDbWTbRkNM1ZupmTubhUvxvRCgvJp1k0c5yrHph+F+++W5eYho92xnkNgd62BS27i0iDRGzGSmsaPpK7MFcdlvnbbnmDZZJ0LH6RhYiJLYKl+znllQx3jNfCRjV28o22FZ35Q43mZTsS4uAZWbZ/KfaqWoV3sN62Cjj8DSg3mD6GCGWSVbxLq58DUxAq+6GwJ7Gj0Dc9nMXP3gnFW7dodQ9AjL2iHnH6Zh1Pw2D5/ung=="
}

Http Body
{
"head":{
"applyStatus":"SUCCESS",
"code":"0",
"msg":"SUCCESS",
"traceCode":"0837"
},
"body":{
"fundoutInfo":{
"fundoutAmount":{
"amount":27.21,
"currency":"USD"
},
"networkCode":"LOCAL",
"orderAmount":{
"amount":100,
"currency":"AED"
},
"rate":0.27210884
}
}
}